package com.gary.core.orm.query;

public class BetweenQueryItem extends DefaultQueryItem {
	
	private Object endValue;
	
	public BetweenQueryItem(){}
	
	public BetweenQueryItem(String connector, String fieldName, Object value,Object endValue) {
		super(connector,fieldName,value);
		this.endValue = endValue;
	}
	
	@Override
	public Object[] getQueryItem() {
		Object[] result={"","",""};
		result[0] = " "+ connector + " "+ fieldName + " between ? and ?";
		result[1] = value;
		result[2] = endValue;
		return result;
	}
	
	public Object getEndValue() {
		return endValue;
	}

	public void setEndValue(Object endValue) {
		this.endValue = endValue;
	}

	public String toString(){
		return " "+ connector + " "+ fieldName +" between '" + value + "' and '"+endValue+"'";
	}
}
